package com.zhao.wechat.job;

import com.zhao.wechat.service.PushDailyWechat;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 推送消息到用户定时任务
 */
@Component
public class PushWechatJob {

	@Autowired
    private PushDailyWechat pushDailyWechat;

	/**
	 * 每天早上7点推送到微信
	 * @throws WxErrorException
	 */
	@Scheduled(cron = "0 30 7 1/1 * ? ")
	void  doJob() throws WxErrorException {
		pushDailyWechat.pushWechat();
	}
}
